Task Based Help > Customize Page Header > Dynamically changing of Page Header |
To specify whether Page Header and Page Footer sections should appear on all pages, or be suppressed on the pages that contain the report Header and report Footer sections use C1.C1Report.C1Report's C1.C1Report.Layout.PageHeader and C1.C1Report.Layout.PageFooter properties.
Sometimes you may want to further customize this behavior. For example, you may want to render different headers on odd and even pages. This can be done with script that shows or hides fields depending on the page being rendered. To do this, complete the following steps:
odd = (page mod 2 <> 0)
h1odd.Visible = odd
h2odd.Visible = odd
h1even.Visible = not odd
h2even.Visible = not odd
This script will show or hide fields for odd and even pages if a report header contains several fields named "h<x>odd" and "h<x>even".
Note that to prevent the page header from showing blank spaces, all the fields should have the C1.C1Report.Field.CanShrink property set to True.
Sample Report Available: For the complete report, see report "09: Dynamic Page Header" in the CommonTasks.xml report definition file, which is available for download from the CommonTasks sample on the ComponentOne HelpCentral Sample page. |